export function listEqual(mlist, mlist1) {
  if (mlist.length !== mlist1.length) {
    return false;
  }
  return mlist.every((it) => {
    return mlist1.contains(it);
  });
}

function cal(count,) {

}

export function calculateSelected(modellist, isPojo) {
  var count = 0,
    selectedCount = 0,
    result = {};

  if (!modellist) {
    result.none = true;
    return result;
  }
  modellist.forEach((it) => {
    count++;
    var sed = isPojo ? it.isSelected : it.get('isSelected');
    if (sed) {
      selectedCount++;
    }
  });

  if (selectedCount === 0) {
    result.none = true;
  }

  if (selectedCount === count && count !== 0) {
    result.all = true;
  }

  if (selectedCount === 1) {
    result.one = true;
  }

  if (selectedCount > 0) {
    result.some = true;
  }

  return result;
}
